package com.sgu6.sgu6_machine.container;

import com.sgu6.middleware.enums.MachineStatusEnum;
import com.sgu6.redis.dto.MachineInfoCacheDto;
import com.sgu6.redis.dto.OrderInfoCacheDto;
import com.sgu6.sgu6_machine.dto.MachineConfigDto;

public class MachineContainer {

    private static String TAG = MachineContainer.class.getCanonicalName();

    public static MachineInfoCacheDto machineInfo;
    public static int MACHINE_STATUS = MachineStatusEnum.待机.code(); //机器状态 -2：关机，-1：停机，0：离线，1：待机，2:打米中
    public static int barnCmd = 1; //1为A谷仓，2为B谷仓，处理谷仓无谷标志
    public static boolean isConsumption = true;

    public static String riceName = "胚芽米";
    public static String categoryId = "",barnId = "";//碾米类型id
    public static boolean isPay = true;//扫码碾米，后台碾米
    public static boolean machineTempOK = false;//机器温度ok
    public static MachineConfigDto machineConfigDto;
    public static OrderInfoCacheDto orderInfoCacheDto = new OrderInfoCacheDto();


    static {
//        orderInfoCacheDto.setMachineNo("000-0000000");
        orderInfoCacheDto.setMakeNum(1);
        orderInfoCacheDto.setFinishNo(0);
    }


    public static int getMachineStatus() {
        return MACHINE_STATUS;
    }

    public static void setMachineStatus(int newStatus) {
        MACHINE_STATUS = newStatus;
    }

    public static void clearOrderCache() {
        orderInfoCacheDto.setMakeNum(1);
        orderInfoCacheDto.setFinishNo(0);
        orderInfoCacheDto.setOrderNo("");
    }

}
